#include <iostream>
#include <math.h>

using namespace std;

// Define some constants
const double PI = 3.1415;
const int MAX_RANGE = 32768;

void main(){

	// Set the x/y for the 90 degree triangle
	float x = 16000;
	float y = 16000;

	float h;

	// Polar Vector
	float ang,vel;

	h = sqrt((x*x)+(y*y));		// The hypotenuse of x/y

	ang = atan2(y,x)*180/PI;	// The angle of x/h

	vel = (h/MAX_RANGE)*100;	// vel = percentage out of 100

	// Diagnostic output
	cout << "X= " << x 
		 << ", Y= " << y 
		 << ", H= " << h 
		 << ", ang= " << ang 
		 << ", vel= " << vel 
		 << endl;

	// Wait
	cin.get();
}